package com.sip.stream.utils.zfy.config;

import com.sip.stream.media.ZFYMediaStatus;

public class ZFYPlatformMediaConfig implements IPlatformMediaConfig {
    ZFYMediaConfig config;
    ZFYMediaStatus status;

    @Override
    public int getAudioBitDepth() {
        return 16;
    }

    @Override
    public String getAudioMime() {
        return "";
    }

    @Override
    public int getAudioSampleRate() {
        return 16000;
    }

    @Override
    public int getChannelCount() {
        return 1;
    }

    private ZFYPlatformMediaConfig() {
    }

    public ZFYPlatformMediaConfig(ZFYMediaConfig zFYMediaConfig, ZFYMediaStatus zFYMediaStatus) {
        this.config = zFYMediaConfig;
        this.status = zFYMediaStatus;
    }

    @Override
    public String getVideoMime() {
        return this.config.isDualStream() ? this.config.getStreamMinetype() : this.config.getVideoMinetype();
    }

    @Override
    public int getVideoHeight() {
        ZFYMediaStatus zFYMediaStatus = this.status;
        return zFYMediaStatus == null ? this.config.isDualStream() ? this.config.getStreamHeight() : this.config.getVideoHeight() : zFYMediaStatus.getCameraParameters().getRemoteHeight();
    }

    @Override
    public int getVideoWidth() {
        ZFYMediaStatus zFYMediaStatus = this.status;
        return zFYMediaStatus == null ? this.config.isDualStream() ? this.config.getStreamWidth() : this.config.getVideoWidth() : zFYMediaStatus.getCameraParameters().getRemoteWidth();
    }

    @Override
    public int getVideoFps() {
        return this.config.isDualStream() ? this.config.getStreamFPS() : this.config.getVideoFPS();
    }

    @Override
    public int getVideoBitrate() {
        return this.config.getStreamBitRate();
    }
}
